1. Field of the Invention
The present invention relates to the area of data communication, and more particularly to method and device for multiple master devices to access slave devices via a data bus (e.g., a unibus). In one embodiment, a device gets data from other equipments by using a simple customized file allocation table (FAT) file system. Based on the Universal Serial Bus (USB) Technology, Mass Storage Technology (MST) and FAT File System, the device realizes single file transmission with any equipment.
2. Description of Related Art
Generally, a Universal Serial Bus (USB) interface can support data exchange or communication between two equipments. FIG. 1 shows a standard block diagram of a communication system provided with a Universal Serial Bus (USB) interface, by which a master device of the system is able to communicate with a slave device. The master device can autonomously initiate communication operations and send commands and data over the USB. The slave device can respond to the external stimulus of the master device by providing data or status report on the USB.
When a USB Mass Storage Equipment, such as a U-disk or a mobile hardware which serves as a slave device, is inserted into a USB connector of a personal computer which serves as the master device. It is assumed that the master device is installed a Windows Operating System (OS), such as Windows 2000 or Windows XP, the Windows OS will automatically detect and identify the USB equipment. If the USB storage equipment is used for the first time, it should be formatted according to a File Allocation Table (FAT) system or New Technology File System (NTFS) by the personal computer, otherwise, it can be directly accessed by the personal computer.
Specifically, the master device may send a reading or a writing command specified in a Mass Storage protocol to the USB equipment. The USB storage equipment interprets these commands and sends operation commands to a memory thereof. The Mass Storage protocol is a USB disk operation protocol cluster based on the USB protocol to encapsulate the minitype computer interface SCSI protocol. In fact, the data in the USB storage equipment is managed by the file system of the personal computer.
A storage device does not need to be embedded with a file system to manage the data therein. However, some special storage modules, such as those in a MP3 player or a mobile telephone, need to embed a file system to conveniently manage the data therein.
FIG. 2 shows a block diagram of a file system 200 embedded in a USB storage device. When the USB storage device is formatted, a parameter block 202, one or more file allocation tables 204, a root directory 206 and a data area 208 are created. The parameter block 202 contains various descriptive information of the USB storage device, such as a sector number per FAT, a volume of each sector and each cluster, a number of reserved sectors, a number of FATs, a total sector number managed by the file system, file system types and signature etc.. The root directory 206 contains files names and a first cluster number assigned to each files. The FAT contains link lists of clusters assigned to the files which ensure the file can be stored in discontinuous sectors.
When a file on the USB storage device requires to be accessed, the first cluster number assigned to the file is obtained from the root directory 206. From the entry point on, the number of the next cluster assigned to the file is obtained from the FAT, until an end-of-cluster mark is encountered. However, this file system has following deficiencies: firstly, it takes a relative long time to develop a USB storage device with a conventional file system as such the overall cost of the product is of high. Secondly, in some special applications, such as only one file needs to be stored during the whole service life of the USB storage device, it becomes efficient to use such USB storage device with an embedded file system.
Thus there is a need for techniques for providing a simple file system to facilitate the file transmission.